class Persons{
  id: number;
  name: string;
  age: number = 18;
  static gender: string = '大一';

  constructor(name: string, id: number){
    this.name = name
    this.id = id
  }

  show(){
    return `hello, I am ${this.name}, and I am ${this.age} years old. `
  }

  static show02(){
    return `hello world`
  }
}

let pp = new Persons('张三', 2)
console.log(pp.name)
console.log(pp.show())
console.log(Persons.gender)
console.log(Persons.show02())


class Student extends Persons{
  className: string;

  constructor(name: string, id: number, className: string){
    super(name, id)
    this.className = className
  }

  show(): string {
      return super.show() + ',I am student.'
  }
}

let s = new Student('李四', 3, '大一')
console.log(s.show())
console.log(s.name)
